package com.ruoyi.shoufang.domain;

import lombok.Getter;

@Getter
public enum CertificateType {

    IDCARD("身份证", 0),
    passport("护照", 1),
    MILITARYLICENSE("军官证", 2),
    DRIVE("驾驶证", 3),
    ACCOUNTBOOK("户口本", 4),
    MTPS("台胞证", 5),
    HKMACAOPASS("港澳通行证", 6),
    RESIDENCEPERMIT("居住证", 7),
    OTHER("其他", 8);


    private String name;
    private int index;

    private CertificateType(String name, int index){
        this.name = name;
        this.index = index;
    }

    public static String getName(int index){
        CertificateType[] values = CertificateType.values();
        for (CertificateType value : values) {
            if (value.index == index){
                return value.name;
            }
        }
        return IDCARD.name;
    }
}
